<%--
    Document   : EditSaleProgram
    Created on : Dec 18, 2009, 12:27:00 AM
    Author     : Ms.MIAYU
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib  prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<script type="text/javascript" src="<%=request.getContextPath()%>/datepicker/js/datepicker.yuic.js">
</script>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/datepicker/css/datepicker.css"/>
<form method="post">
    <table border="1" align="center">
        <tr>
            <td width="102">Start Date:</td>
            <td>
                <select id="startDate-dd" name="startDate-dd">
                    <c:forEach var="date" begin="1" end="31" step="1">
                        <option value="${date}" ${date==saleProgram.startDate.date?"selected":""}>${class.sgt.supermarket.util.DateExtensions.getDateString$[date]}</option>
                    </c:forEach>

                </select>
                <select id="startDate-mm" name="startDate-mm">
                    <c:forEach var="month" begin="1" end="12" step="1">
                        <option value="${month}" ${month==saleProgram.startDate.month+1?"selected":""}>${class.sgt.supermarket.util.DateExtensions.getMonthString$[month]}</option>
                    </c:forEach>
                </select>

                <select class="split-date range-low-${1900+saleProgram.startDate.year-1}0101 range-high-${1900+saleProgram.startDate.year+1}1231" id="startDate" name="startDate">
                    <c:forEach var="year" begin="${saleProgram.startDate.year-1}" end="${saleProgram.startDate.year+1}" step="1">
                        <option value="${1900+year}" ${year==saleProgram.startDate.year?"selected":""}>${1900+year}</option>
                    </c:forEach>
                </select>
            </td>
        </tr>
        <tr>
            <td>End Date: </td>
            <td>
                <select id="endDate-dd" name="endDate-dd">
                    <c:forEach var="date" begin="1" end="31" step="1">
                        <option value="${date}" ${date==saleProgram.endDate.date?"selected":""}>${class.sgt.supermarket.util.DateExtensions.getDateString$[date]}</option>
                    </c:forEach>

                </select>
                <select id="endDate-mm" name="endDate-mm">
                    <c:forEach var="month" begin="1" end="12" step="1">
                        <option value="${month}" ${month==saleProgram.endDate.month+1?"selected":""}>${class.sgt.supermarket.util.DateExtensions.getMonthString$[month]}</option>
                    </c:forEach>
                </select>

                <select class="split-date range-low-${1900+saleProgram.endDate.year-1}0101 range-high-${1900+saleProgram.endDate.year+1}1231" id="endDate" name="endDate">
                    <c:forEach var="year" begin="${saleProgram.endDate.year-1}" end="${saleProgram.endDate.year+1}" step="1">
                        <option value="${1900+year}" ${year==saleProgram.endDate.year?"selected":""}>${1900+year}</option>
                    </c:forEach>
                </select>
            </td>
        </tr>
        <tr>
            <td>Minimum Invoice Total:</td>
            <td><input type="text" name="minimumInvoiceTotal" value="${saleProgram.minimumInvoiceTotal}" /> VND</td>
        </tr>
        <tr>
            <td>Discount Rate:</td>
            <td ><input type="text" name="discountRate" value="${saleProgram.discountRate}" /></td>
        </tr>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <input type="submit" value="${saleProgram.autoId eq 0 ? "Create" : "Save"}" />
            </td>
        </tr>
    </table>
</form>